﻿using RedisUtil;
using System;
using System.Threading;

namespace 发布者
{
    class Program
    {
        static void Main(string[] args)
        {
            BaseRedis redis = new BaseRedis();

            var channelKey = "SMSChannel";

            for (int i = 0; i < 100; i++)
            {
                // 向Redis SMSChannel 管道发送消息
                redis.Subscriber.Publish(channelKey, $"消息推送内容！{i}");
                Console.WriteLine($"向频道 {channelKey} 发送消息：{i} ");

                Thread.Sleep(2000);
            }

            Console.ReadKey();
        }
    }
}
